<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>oracle学习 | Hexo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="物化视图　　物化视图是存储数据的视图，预先计算并保存表连接或聚集等耗时较多的操作的结果，存储了基础表的全部或者一部分数据，主要用作sql语句的优化，查询物化视图比查询表中的数据速度要快。　　物化视图有很多方面和索引很相似：使用物化视图的目的是为了提高查询性能；物化视图对应用透明，增加和删除物化视图不会影响应用程序中SQL语句的正确性和有效性；实体化视图需要占用存储空间；当基表发生变化时，实体化视图">
<meta property="og:type" content="article">
<meta property="og:title" content="oracle学习">
<meta property="og:url" content="http://yoursite.com/2016/01/27/database/9.oracle学习/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="物化视图　　物化视图是存储数据的视图，预先计算并保存表连接或聚集等耗时较多的操作的结果，存储了基础表的全部或者一部分数据，主要用作sql语句的优化，查询物化视图比查询表中的数据速度要快。　　物化视图有很多方面和索引很相似：使用物化视图的目的是为了提高查询性能；物化视图对应用透明，增加和删除物化视图不会影响应用程序中SQL语句的正确性和有效性；实体化视图需要占用存储空间；当基表发生变化时，实体化视图">
<meta property="og:updated_time" content="2016-01-29T17:47:36.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="oracle学习">
<meta name="twitter:description" content="物化视图　　物化视图是存储数据的视图，预先计算并保存表连接或聚集等耗时较多的操作的结果，存储了基础表的全部或者一部分数据，主要用作sql语句的优化，查询物化视图比查询表中的数据速度要快。　　物化视图有很多方面和索引很相似：使用物化视图的目的是为了提高查询性能；物化视图对应用透明，增加和删除物化视图不会影响应用程序中SQL语句的正确性和有效性；实体化视图需要占用存储空间；当基表发生变化时，实体化视图">
  
    <link rel="alternative" href="/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  <link rel="stylesheet" href="/css/style.css" type="text/css">
  

</head>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Hexo</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" results="0" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-database/9.oracle学习" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2016/01/27/database/9.oracle学习/" class="article-date">
  <time datetime="2016-01-27T07:11:00.000Z" itemprop="datePublished">2016-01-27</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/database/">database</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      oracle学习
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="u7269_u5316_u89C6_u56FE"><a href="#u7269_u5316_u89C6_u56FE" class="headerlink" title="物化视图"></a>物化视图</h2><p>　　物化视图是存储数据的视图，预先计算并保存表连接或聚集等耗时较多的操作的结果，存储了基础表的全部或者一部分数据，主要用作sql语句的优化，查询物化视图比查询表中的数据速度要快。<br>　　物化视图有很多方面和索引很相似：使用物化视图的目的是为了提高查询性能；物化视图对应用透明，增加和删除物化视图不会影响应用程序中SQL语句的正确性和有效性；实体化视图需要占用存储空间；当基表发生变化时，实体化视图也应当刷新（自动或手动）。<br>　　当对物化视图的基表进行查询时，Oracle会自动判断能否通过查询物化视图来得到结果（查询重写），完全对应用透明。这样避免了聚集或连接操作，而直接从已经计算好的实体化视图中读取数据，默认 DISABLE QUERY REWRITE<br>　　物化视图可以直接update，但是不影响base table，对视图的update会反映到base table上; 创建语法为：CREATE MATERIALIZED VIEW</p>
<h2 id="EXISTS"><a href="#EXISTS" class="headerlink" title="EXISTS"></a>EXISTS</h2><p>　　EXISTS(包括 NOT EXISTS )内部有一个子查询语句(SELECT … FROM…)，它返回一个结果集。EXISTS子句根据<strong>其返回的结果集空或者非空，返回一个布尔值</strong>。一种通俗的可以理解为：将外查询表的每一行，代入内查询作为检验，如果内查询返回的结果取非空值，则EXISTS子句返回TRUE，这一行行可作为外查询的结果行，否则不能作为结果。<br>　　EXISTS与IN的使用效率的问题，通常情况下采用exists要比in效率高，因为<strong>IN不走索引</strong>，但要看实际情况具体使用：<br>IN适合于外表大而内表小的情况；EXISTS适合于外表小而内表大的情况。<br><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">-- aa，bb表都有20个字段，且记录数量都很大，aa，bb表的X字段（非空）上有索引</span></span><br><span class="line"><span class="comment">-- 列出aa表里面存在的X在bb表不存在的X的值，最优sql</span></span><br><span class="line"><span class="operator"><span class="keyword">select</span> aa.x <span class="keyword">from</span> aa <span class="keyword">where</span> <span class="keyword">not</span> <span class="keyword">exists</span> (<span class="keyword">select</span> <span class="string">'x'</span> <span class="keyword">from</span> bb <span class="keyword">where</span> aa.x = bb.x) ;</span></span><br><span class="line"><span class="comment">-- 以上语句同时使用到了aa中x的索引和的bb中x的索引</span></span><br></pre></td></tr></table></figure></p>
<p>##Having<br>　　Having对由sum或其他集合函数运算结果的输出进行限制，通常情况下，HAVING从句被放置在SQL命令的结尾处。<br><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">--找出总额大于1500的销量</span></span><br><span class="line"><span class="operator"><span class="keyword">SELECT</span> store_name, <span class="keyword">SUM</span>(sales)  <span class="keyword">FROM</span> Store_Information <span class="keyword">GROUP</span> <span class="keyword">BY</span> store_name <span class="keyword">HAVING</span> <span class="keyword">SUM</span>(sales) &gt; <span class="number">1500</span></span></span><br></pre></td></tr></table></figure></p>
<h2 id="case_when_then_end"><a href="#case_when_then_end" class="headerlink" title="case when then end"></a>case when then end</h2><figure class="highlight"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line">-- 员工表empinfo </span><br><span class="line">( </span><br><span class="line">Fempno varchar2(10) not null pk, </span><br><span class="line">Fempname varchar2(20) not null, </span><br><span class="line">Fage number not null, </span><br><span class="line">Fsalary number not null </span><br><span class="line">); </span><br><span class="line">-- 假如数据量很大约1000万条；用最高效的SQL计算以下四种人： </span><br><span class="line">fsalary&gt;9999 and fage &gt; 35 </span><br><span class="line">fsalary&gt;9999 and fage &lt; 35 </span><br><span class="line">fsalary &lt;9999 and fage &gt; 35 </span><br><span class="line">fsalary &lt;9999 and fage &lt; 35 </span><br><span class="line">-- 每种员工的数量； </span><br><span class="line">select </span><br><span class="line">    sum(case when fsalary &gt; 9999 and fage &gt; 35</span><br><span class="line">        then 1 else 0 end) as "fsalary&gt;9999_fage&gt;35",</span><br><span class="line">    sum(case when fsalary &gt; 9999 and fage &lt; 35</span><br><span class="line">        then 1 else 0 end) as "fsalary&gt;9999_fage&lt;35",</span><br><span class="line">    sum(case when fsalary &lt; 9999 and fage &gt; 35</span><br><span class="line">        then 1 else 0 end) as "fsalary&lt;9999_fage&gt;35",</span><br><span class="line">    sum(case when fsalary &lt; 9999 and fage &lt; 35</span><br><span class="line">        then 1 else 0 end) as "fsalary&lt;9999_fage&lt;35"</span><br><span class="line">from empinfo;</span><br></pre></td></tr></table></figure>
<h2 id="u4F4D_u56FE_u7D22_u5F15"><a href="#u4F4D_u56FE_u7D22_u5F15" class="headerlink" title="位图索引"></a>位图索引</h2><p>　　位图索引主要针对大量相同值的列而创建(例如：类别，操作员，部门ID,库房ID等)</p>
<h2 id="u5343_u4E07_u7EA7_u6570_u636E_u63D2_u5165"><a href="#u5343_u4E07_u7EA7_u6570_u636E_u63D2_u5165" class="headerlink" title="千万级数据插入"></a>千万级数据插入</h2><p>　　1. 没插入一条数据，提交<br>　　2. 批量插入，一次性提交<br>　　3. nologging(不产生日志)<br><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="operator"><span class="keyword">alter</span> <span class="keyword">table</span> table_name1 nologging</span><br><span class="line"><span class="keyword">insert</span> <span class="comment">/*+ append */</span> <span class="keyword">into</span> table_name1 <span class="keyword">select</span> * <span class="keyword">from</span> table_name2</span></span><br></pre></td></tr></table></figure></p>
<p>　　4. parallel<br><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="operator"><span class="keyword">alter</span> <span class="keyword">session</span> <span class="keyword">enable</span> <span class="keyword">parallel</span> dml;</span></span><br><span class="line"><span class="operator"><span class="keyword">insert</span> <span class="comment">/*+parallel(A1,8)*/</span>  <span class="comment">/*+ APPEND */</span> <span class="keyword">into</span> A1  nologging <span class="keyword">select</span> <span class="comment">/*+parallel(A2,10)*/</span> * <span class="keyword">from</span> A2 ;</span></span><br></pre></td></tr></table></figure></p>
<p>　　5. 关索引</p>
<h2 id="DBLink"><a href="#DBLink" class="headerlink" title="DBLink"></a>DBLink</h2><h2 id="rollup"><a href="#rollup" class="headerlink" title="rollup"></a>rollup</h2><h2 id="rman"><a href="#rman" class="headerlink" title="rman"></a>rman</h2><h2 id="u4E3B_u952E_u81EA_u589E"><a href="#u4E3B_u952E_u81EA_u589E" class="headerlink" title="主键自增"></a>主键自增</h2><p>　　在oracle中，主键自动递增需要sequence和触发器配合使用。sequence就是序号，每次取的时候它会自动增加，注意：<strong>sequence与表没有关系</strong>。</p>
<h4 id="Create_Sequence"><a href="#Create_Sequence" class="headerlink" title="Create Sequence"></a>Create Sequence</h4><p>　　首先要有CREATE SEQUENCE或者CREATE ANY SEQUENCE权限。创建语句如下：<br><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="operator"><span class="keyword">CREATE</span> <span class="keyword">SEQUENCE</span> seqTest</span><br><span class="line">  <span class="keyword">INCREMENT</span> <span class="keyword">BY</span> <span class="number">1</span> <span class="comment">-- 每次加几个</span></span><br><span class="line">  <span class="keyword">START</span> <span class="keyword">WITH</span> <span class="number">1</span> <span class="comment">-- 从1开始计数</span></span><br><span class="line">  <span class="keyword">NOMAXvalue</span> <span class="comment">-- 不设置最大值</span></span><br><span class="line">  <span class="keyword">NOCYCLE</span> <span class="comment">-- 一直累加，不循环</span></span><br><span class="line">  <span class="keyword">CACHE</span> <span class="number">10</span>;</span> <span class="comment">--设置缓存cache个序列，如果系统down掉了或者其它情况将会导致序列不连续，也可以设置为NOCACHE</span></span><br></pre></td></tr></table></figure></p>
<h4 id="u83B7_u53D6Sequence_u503C"><a href="#u83B7_u53D6Sequence_u503C" class="headerlink" title="获取Sequence值"></a>获取Sequence值</h4><p>　　定义好sequence后，你就可以用currVal，nextVal取得值。CurrVal：返回sequence的当前值。NextVal：增加sequence的值再返回，语法为：SELECT Sequence名称.CurrVal FROM DUAL;<br><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">-- 自增长的字段</span></span><br><span class="line"><span class="operator"><span class="keyword">insert</span> <span class="keyword">into</span> 表名(<span class="keyword">id</span>,<span class="keyword">name</span>)<span class="keyword">values</span>(seqtest.<span class="keyword">Nextval</span>,<span class="string">'sequence 插入测试'</span>);</span></span><br></pre></td></tr></table></figure></p>
<p>　　注意：<br>　　1. 第一次NEXTVAL返回的是初始值，随后的NEXTVAL会自动增加定义的INCREMENT BY值，然后返回增加后的值。<br>　　2. CURRVAL在第一次NEXTVAL初始化之后才能使用CURRVAL，否则会出错。<br>　　3. 一次NEXTVAL会增加一次SEQUENCE的值，所以在同一个语句里面使用多个NEXTVAL，其值就是不一样的。<br>　　4. 如果指定CACHE值，ORACLE就可以预先在内存里面放置一些sequence，这样存取的快些。cache里面的取完后，oracle自动再取一组到cache。使用cache或许会跳号，比如数据库突然不正常down掉（shutdown abort)，cache中的sequence就会丢失。所以可以在create sequence的时候用nocache防止这种情况。</p>
<h4 id="Alter_Sequence"><a href="#Alter_Sequence" class="headerlink" title="Alter Sequence"></a>Alter Sequence</h4><p>　　拥有ALTER ANY SEQUENCE权限才能改动sequence，可以alter除start值以外的所有sequence参数，如果想要改变start值，必须drop sequence再re-create。<br><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="operator"><span class="keyword">alter</span> <span class="keyword">sequence</span> SEQTEST maxvalue <span class="number">9999999</span>;</span></span><br><span class="line"><span class="operator"><span class="keyword">DROP</span> <span class="keyword">SEQUENCE</span> seqTest;</span></span><br></pre></td></tr></table></figure></p>
<h4 id="u793A_u4F8B"><a href="#u793A_u4F8B" class="headerlink" title="示例"></a>示例</h4><p>　　通过触发器和sequence实现主键自增<br><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line"><span class="operator"><span class="keyword">create</span> <span class="keyword">sequence</span> SEQ_ID</span><br><span class="line">  <span class="keyword">minvalue</span> <span class="number">1</span></span><br><span class="line">  maxvalue <span class="number">99999999</span></span><br><span class="line">  <span class="keyword">start</span> <span class="keyword">with</span> <span class="number">1</span></span><br><span class="line">  <span class="keyword">increment</span> <span class="keyword">by</span> <span class="number">1</span></span><br><span class="line">  nocache</span><br><span class="line">  <span class="keyword">order</span>;</span></span><br><span class="line"></span><br><span class="line"><span class="comment">-- 创建触发器</span></span><br><span class="line"><span class="operator"><span class="keyword">create</span> <span class="keyword">or</span> <span class="keyword">replace</span> <span class="keyword">trigger</span> tri_test_id</span><br><span class="line">  <span class="keyword">before</span> <span class="keyword">insert</span> <span class="keyword">on</span> S_Depart   <span class="comment">--S_Depart 是表名</span></span><br><span class="line">  <span class="keyword">for</span> <span class="keyword">each</span> <span class="keyword">row</span></span><br><span class="line"><span class="keyword">declare</span></span><br><span class="line">  nextid <span class="built_in">number</span>;</span></span><br><span class="line"><span class="operator"><span class="keyword">begin</span></span><br><span class="line">  <span class="keyword">IF</span> :<span class="keyword">new</span>.DepartId <span class="keyword">IS</span> <span class="literal">NULL</span> <span class="keyword">or</span> :<span class="keyword">new</span>.DepartId=<span class="number">0</span> <span class="keyword">THEN</span> <span class="comment">--DepartId是列名</span></span><br><span class="line">    <span class="keyword">select</span> SEQ_ID.<span class="keyword">nextval</span> <span class="comment">--SEQ_ID正是刚才创建的</span></span><br><span class="line">    <span class="keyword">into</span> nextid</span><br><span class="line">    <span class="keyword">from</span> <span class="keyword">sys</span>.dual;</span></span><br><span class="line">    :new.DepartId:=nextid;</span><br><span class="line">  <span class="operator"><span class="keyword">end</span> <span class="keyword">if</span>;</span></span><br><span class="line"><span class="operator"><span class="keyword">end</span> tri_test_id;</span></span><br></pre></td></tr></table></figure></p>
<p>　　:new 代表数据改变后的新值，相对应的有:old原值<br>　　:= 代表赋值<br>　　:nextid表示引用sqlplus中定义的变量</p>
<h2 id="u4E24_u5217_u4E92_u6362"><a href="#u4E24_u5217_u4E92_u6362" class="headerlink" title="两列互换"></a>两列互换</h2><p>　　sql执行正确：update atest set name1 = name2, name2=name1<br>　　分析：在手动提交事物的情况下，name2的值给name1，由于事物未提交，此时name1原值仍然存在（此时name1的新值未冲掉原值）</p>
<h2 id="u6811_u67E5_u8BE2"><a href="#u6811_u67E5_u8BE2" class="headerlink" title="树查询"></a>树查询</h2><p>　　语法：select … from tablename start with 条件1 connect by 条件2 where 条件3;<br>　　示例：select * from table start with org_id = ‘HBHqfWGWPy’ connect by prior org_id = parent_id;<br>　　条件1：根结点的限定语句，当然可以放宽限定条件，以取得多个根结点，实际就是多棵树。<br>　　条件2：连接条件，其中用PRIOR表示上一条记录，比如 CONNECT BY PRIOR org_id = parent_id就是说上一条记录的org_id 是本条记录的parent_id，即本记录的父亲是上一条记录。<br>　　条件3：过滤条件，用于对返回的所有记录进行过滤。<br>　　扫描树结构表时，需要依此访问树结构的每个节点，一个节点只能访问一次，其访问步骤为：1. 从根节点开始；2.访问该节点；3. 判断该节点有无未被访问的子节点，若有，则转向它最左侧的未被访问的子节，并执行第二步，否则执行第四步；4. 若该节点为根节点，则访问完毕，否则执行第五步；5. 返回到该节点的父节点，并执行第三步骤。<br>　　总之：扫描整个树结构的过程也即是中序遍历树的过程。<br>　　PRIORY运算符必须放置在连接关系的两列中某一个的前面。对于节点间的父子关系，PRIOR运算符在一侧表示父节点，在另一侧表示子节点，从而确定查找树结构是的顺序是自顶向下还是自底向上。在连接关系中，除了可以使用列名外，还允许使用列表达式。START WITH子句为可选项，用来标识哪个节点作为查找树型结构的根节点。若该子句被省略，则表示所有满足查询条件的行作为根节点。<br>    START WITH：不但可以指定一个根节点，还可以指定多个根节点。</p>
<h4 id="u5173_u4E8EPRIOR"><a href="#u5173_u4E8EPRIOR" class="headerlink" title="关于PRIOR"></a>关于PRIOR</h4><p>　　PRIOR被放置于等号前后的位置，决定着查询时的检索顺序。PRIOR被置于CONNECT BY子句中等号的前面时，则强制从根节点到叶节点的顺序检索，即由父节点向子节点方向通过树结构，我们称之为自顶向下的方式。如：CONNECT BY PRIOR EMPNO=MGR<br>　　PIROR被置于CONNECT BY子句中等号的后面时，则强制从叶节点到根节点的顺序检索，即由子节点向父节点方向通过树结构，我们称之为自底向上的方式。例如：CONNECT BY EMPNO=PRIOR MGR。在这种方式中也应指定一个开始的节点。</p>
<h4 id="u5B9A_u4E49_u67E5_u627E_u8D77_u59CB_u8282_u70B9"><a href="#u5B9A_u4E49_u67E5_u627E_u8D77_u59CB_u8282_u70B9" class="headerlink" title="定义查找起始节点"></a>定义查找起始节点</h4><p>　　在自顶向下查询树结构时，不但可以从根节点开始，还可以定义任何节点为起始节点，以此开始向下查找。这样查找的结果就是以该节点为开始的结构树的一枝。</p>
<h4 id="u4F7F_u7528LEVEL"><a href="#u4F7F_u7528LEVEL" class="headerlink" title="使用LEVEL"></a>使用LEVEL</h4><p>　　在具有树结构的表中，每一行数据都是树结构中的一个节点，由于节点所处的层次位置不同，所以每行记录都可以有一个层号。层号根据节点与根节点的距离确定。不论从哪个节点开始，该起始根节点的层号始终为1，根节点的子节点为2，依此类推。</p>
<h4 id="u8282_u70B9_u548C_u5206_u652F_u7684_u88C1_u526A"><a href="#u8282_u70B9_u548C_u5206_u652F_u7684_u88C1_u526A" class="headerlink" title="节点和分支的裁剪"></a>节点和分支的裁剪</h4><p>　　在对树结构进行查询时，可以去掉表中的某些行，也可以剪掉树中的一个分支，使用WHERE子句来限定树型结构中的单个节点，以去掉树中的单个节点，但它却不影响其后代节点（自顶向下检索时）或前辈节点（自底向顶检索时）。</p>
<h4 id="u6392_u5E8F_u663E_u793A"><a href="#u6392_u5E8F_u663E_u793A" class="headerlink" title="排序显示"></a>排序显示</h4><p>　　象在其它查询中一样，在树结构查询中也可以使用ORDER BY 子句，改变查询结果的显示顺序，而不必按照遍历树结构的顺序。<br><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">-- 创建示例表：</span></span><br><span class="line"><span class="operator"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> TBL_TEST(</span><br><span class="line">  <span class="keyword">ID</span> <span class="built_in">NUMBER</span>,</span><br><span class="line">  <span class="keyword">NAME</span> VARCHAR2(<span class="number">100</span> <span class="keyword">BYTE</span>),</span><br><span class="line">  PID <span class="built_in">NUMBER</span> <span class="keyword">DEFAULT</span> <span class="number">0</span></span><br><span class="line">);</span></span><br><span class="line"><span class="comment">-- 插入测试数据：</span></span><br><span class="line"><span class="operator"><span class="keyword">INSERT</span> <span class="keyword">INTO</span> TBL_TEST(<span class="keyword">ID</span>,<span class="keyword">NAME</span>,PID) <span class="keyword">VALUES</span>(<span class="string">'1'</span>,<span class="string">'10'</span>,<span class="string">'0'</span>);</span></span><br><span class="line"><span class="operator"><span class="keyword">INSERT</span> <span class="keyword">INTO</span> TBL_TEST(<span class="keyword">ID</span>,<span class="keyword">NAME</span>,PID) <span class="keyword">VALUES</span>(<span class="string">'2'</span>,<span class="string">'11'</span>,<span class="string">'1'</span>);</span></span><br><span class="line"><span class="operator"><span class="keyword">INSERT</span> <span class="keyword">INTO</span> TBL_TEST(<span class="keyword">ID</span>,<span class="keyword">NAME</span>,PID) <span class="keyword">VALUES</span>(<span class="string">'3'</span>,<span class="string">'20'</span>,<span class="string">'0'</span>);</span></span><br><span class="line"><span class="operator"><span class="keyword">INSERT</span> <span class="keyword">INTO</span> TBL_TEST(<span class="keyword">ID</span>,<span class="keyword">NAME</span>,PID) <span class="keyword">VALUES</span>(<span class="string">'4'</span>,<span class="string">'12'</span>,<span class="string">'1'</span>);</span></span><br><span class="line"><span class="operator"><span class="keyword">INSERT</span> <span class="keyword">INTO</span> TBL_TEST(<span class="keyword">ID</span>,<span class="keyword">NAME</span>,PID) <span class="keyword">VALUES</span>(<span class="string">'5'</span>,<span class="string">'121'</span>,<span class="string">'2'</span>);</span></span><br><span class="line"><span class="comment">-- 从Root往树末梢递归</span></span><br><span class="line"><span class="operator"><span class="keyword">select</span> * <span class="keyword">from</span> TBL_TEST <span class="keyword">start</span> <span class="keyword">with</span> <span class="keyword">id</span>=<span class="number">1</span> <span class="keyword">connect</span> <span class="keyword">by</span> <span class="keyword">prior</span> <span class="keyword">id</span> = pid</span><br><span class="line"><span class="comment">-- 从末梢往树ROOT递归</span></span><br><span class="line"><span class="keyword">select</span> * <span class="keyword">from</span> TBL_TEST <span class="keyword">start</span> <span class="keyword">with</span> <span class="keyword">id</span>=<span class="number">5</span> <span class="keyword">connect</span> <span class="keyword">by</span> <span class="keyword">prior</span> pid = <span class="keyword">id</span></span></span><br></pre></td></tr></table></figure></p>
<h2 id="Parallel"><a href="#Parallel" class="headerlink" title="Parallel"></a>Parallel</h2><p>　　在系统中，有2个4核心的CPU，那么一共8个逻辑CPU。每当ORACLE进行查询时，就会产生一个session，每个session占用一个CPU。当整个系统只有一个人在用的时候，剩下7个CPU，是空闲状态。那么就可以用parallel语句合理利用起来剩下7个CPU。<br>　　注意：当系统有很多用户连接时，开启parallel不是一个明确的选择。同时只有在需要<strong>处理一个很大的任务</strong>，如需要几个小时的作业中，并且要有足够的系统资源的情况下(这些资源包括cpu、内存和io)，才应该考虑使用parallel。否则，在一个多并发用户下，系统本身资源负担已经很大的情况下，启用parallel，将会导致某一个会话试图占用了所有的资源不，其他会话得不去等待，从而导致系统系能反而下降的情况。<br>　　Parallel分类：并行查询parallel query、并行dml parallel dml(pdml)、并行ddl parallel ddl(pddl)，语法：/<em>+parallel(table_short_name, cash_number)</em>/</p>
<h4 id="u5E76_u884C_u67E5_u8BE2"><a href="#u5E76_u884C_u67E5_u8BE2" class="headerlink" title="并行查询"></a>并行查询</h4><p>　　并行查询可以在查询语句，子查询语句中使用，但是不可以使用在一个远程引用的对象上（如DBLINK）。一个查询能够并行执行，需要满足一下条件：<br>（1）SQL语句中有Hint提示，比如Parallel 或者 Parallel_index.<br>（2）SQL语句中引用的对象被设置了并行属性。<br>（3）多表关联中，至少有一个表执行全表扫描（Full table scan）或者跨分区的Index range SCAN。<br><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">-- 开启并行查询就是对于某个TABLE</span></span><br><span class="line"><span class="operator"><span class="keyword">alter</span> <span class="keyword">table</span> TABLE_NAME <span class="keyword">parallel</span> <span class="number">8</span></span><br><span class="line"><span class="comment">-- 将对于TABLE_NAME 这个表的查询改为8核</span></span><br><span class="line"><span class="keyword">select</span> <span class="comment">/*+ parallel(t1 8) */</span> <span class="keyword">count</span>(*) <span class="keyword">from</span> t1;</span></span><br><span class="line"><span class="comment">-- 只对于本次SQL有效</span></span><br><span class="line"><span class="comment">-- 测试不好用，没有加快，取消并行设置</span></span><br><span class="line"><span class="operator"><span class="keyword">alter</span> <span class="keyword">table</span> t1 noparallel</span></span><br></pre></td></tr></table></figure></p>
<h4 id="u5E76_u884Cdml"><a href="#u5E76_u884Cdml" class="headerlink" title="并行dml"></a>并行dml</h4><p>　　并行dml包括insert，update，delete，merge，在pdml期间，oracle可以使用多个并行执行服务器来执行insert，update，delete，merge，多个会话同时执行，同时每个会话(并发进程)都有自己的undo段，都是独立的一个事务，这些事务要么由pdml协调器进程提交，要么都rollback。在一个有充足I/o带宽的多cpu主机中，对于大规模的dml，速度可能会有很大的提升，尤其是在大型的数据仓库环境中。<br><figure class="highlight"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">SQL&gt; alter session enable parallel dml; 开启</span><br><span class="line">SQL&gt; alter session disable parallel dml; 关闭</span><br></pre></td></tr></table></figure></p>
<h4 id="Insert__u7684_u5E76_u884C_u64CD_u4F5C"><a href="#Insert__u7684_u5E76_u884C_u64CD_u4F5C" class="headerlink" title="Insert 的并行操作"></a>Insert 的并行操作</h4><p>　　实际上只有对于insert into … select … 这样的SQL语句启用并行才有意义。 对于insert into .. values… 并行没有意义，因为这条语句本身就是一个单条记录的操作。<br><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">-- 操作insert和select分别使用并行，这两个并行是相互独立，互补干涉的，也可以单独使用其中的一个并行。</span></span><br><span class="line"><span class="operator"><span class="keyword">Insert</span> <span class="comment">/*+parallel(t 2) */</span> <span class="keyword">into</span> <span class="keyword">t</span> <span class="keyword">select</span> <span class="comment">/*+parallel(t1 2) */</span> * <span class="keyword">from</span> t1;</span></span><br></pre></td></tr></table></figure></p>
<p>　　Parallel比较邪恶，对开发者而言，不是好东西，会养成不好习惯，导致很多bad SQL不会暴漏，SQL Tuning的能力得不到提升</p>
<h2 id="u53C2_u8003_u94FE_u63A5"><a href="#u53C2_u8003_u94FE_u63A5" class="headerlink" title="参考链接"></a>参考链接</h2>
      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2016/01/27/database/9.oracle学习/" data-id="cijzzpvgv00g31cfsshv0k6jy" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/database/">database</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2016/01/27/database/10.oracle spatial/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          oracle spatial
        
      </div>
    </a>
  
  
    <a href="/2016/01/27/java/17.缓存实现/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">缓存实现</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Categories</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/cache/">cache</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/database/">database</a><span class="category-list-count">13</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/docker/">docker</a><span class="category-list-count">6</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/gis/">gis</a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/git/">git</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/go/">go</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/gradle/">gradle</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/groovy/">groovy</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/hadoop/">hadoop</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/java/">java</a><span class="category-list-count">18</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/linux/">linux</a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/log/">log</a><span class="category-list-count">11</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/mongodb/">mongodb</a><span class="category-list-count">14</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/mq/">mq</a><span class="category-list-count">6</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/mybatis/">mybatis</a><span class="category-list-count">9</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/netty/">netty</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/nginx/">nginx</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/nio/">nio</a><span class="category-list-count">19</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/nodejs/">nodejs</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/redis/">redis</a><span class="category-list-count">6</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/rpc/">rpc</a><span class="category-list-count">14</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/spring/">spring</a><span class="category-list-count">5</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/tomcat/">tomcat</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/zookeeper/">zookeeper</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/杂项/">杂项</a><span class="category-list-count">2</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/aop/">aop</a><span class="tag-list-count">8</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/aspectj/">aspectj</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/cache/">cache</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/classloader/">classloader</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/common-loggings/">common-loggings</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/commonjs/">commonjs</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/database/">database</a><span class="tag-list-count">10</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/docker/">docker</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/dubbo/">dubbo</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/fastdfs/">fastdfs</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/gclib/">gclib</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/geohash/">geohash</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/gis/">gis</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/git/">git</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/go/">go</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/gradle/">gradle</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/groovy/">groovy</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hadoop/">hadoop</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hessisan/">hessisan</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/java/">java</a><span class="tag-list-count">48</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/javassist/">javassist</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/kafka/">kafka</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/linux/">linux</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/log/">log</a><span class="tag-list-count">11</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/log4j/">log4j</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/logback/">logback</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/map/">map</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/memecached/">memecached</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mina/">mina</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mongodb/">mongodb</a><span class="tag-list-count">14</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mq/">mq</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mqtt/">mqtt</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mybatis/">mybatis</a><span class="tag-list-count">9</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/netty/">netty</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/nginx/">nginx</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/nio/">nio</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/nodejs/">nodejs</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/postgresql/">postgresql</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/protobuf/">protobuf</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/proxy/">proxy</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/push/">push</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/rabbitmq/">rabbitmq</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/redis/">redis</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/rpc/">rpc</a><span class="tag-list-count">14</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/sitemesh/">sitemesh</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/sld/">sld</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/slf4j/">slf4j</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/socket/">socket</a><span class="tag-list-count">7</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/spatialite-for-android/">spatialite for android</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/spi/">spi</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/spring/">spring</a><span class="tag-list-count">13</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/tomcat/">tomcat</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/transaction/">transaction</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/web/">web</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/xSocket/">xSocket</a><span class="tag-list-count">7</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/zbus/">zbus</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/zookeeper/">zookeeper</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/数据结构/">数据结构</a><span class="tag-list-count">2</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/aop/" style="font-size: 15.38px;">aop</a> <a href="/tags/aspectj/" style="font-size: 11.54px;">aspectj</a> <a href="/tags/cache/" style="font-size: 11.54px;">cache</a> <a href="/tags/classloader/" style="font-size: 10px;">classloader</a> <a href="/tags/common-loggings/" style="font-size: 10px;">common-loggings</a> <a href="/tags/commonjs/" style="font-size: 12.31px;">commonjs</a> <a href="/tags/database/" style="font-size: 16.92px;">database</a> <a href="/tags/docker/" style="font-size: 13.85px;">docker</a> <a href="/tags/dubbo/" style="font-size: 10px;">dubbo</a> <a href="/tags/fastdfs/" style="font-size: 10px;">fastdfs</a> <a href="/tags/gclib/" style="font-size: 10.77px;">gclib</a> <a href="/tags/geohash/" style="font-size: 10px;">geohash</a> <a href="/tags/gis/" style="font-size: 10px;">gis</a> <a href="/tags/git/" style="font-size: 10.77px;">git</a> <a href="/tags/go/" style="font-size: 10px;">go</a> <a href="/tags/gradle/" style="font-size: 10px;">gradle</a> <a href="/tags/groovy/" style="font-size: 10px;">groovy</a> <a href="/tags/hadoop/" style="font-size: 10px;">hadoop</a> <a href="/tags/hessisan/" style="font-size: 11.54px;">hessisan</a> <a href="/tags/java/" style="font-size: 20px;">java</a> <a href="/tags/javassist/" style="font-size: 10px;">javassist</a> <a href="/tags/kafka/" style="font-size: 11.54px;">kafka</a> <a href="/tags/linux/" style="font-size: 12.31px;">linux</a> <a href="/tags/log/" style="font-size: 17.69px;">log</a> <a href="/tags/log4j/" style="font-size: 12.31px;">log4j</a> <a href="/tags/logback/" style="font-size: 13.08px;">logback</a> <a href="/tags/map/" style="font-size: 10px;">map</a> <a href="/tags/memecached/" style="font-size: 10.77px;">memecached</a> <a href="/tags/mina/" style="font-size: 13.08px;">mina</a> <a href="/tags/mongodb/" style="font-size: 19.23px;">mongodb</a> <a href="/tags/mq/" style="font-size: 13.85px;">mq</a> <a href="/tags/mqtt/" style="font-size: 10.77px;">mqtt</a> <a href="/tags/mybatis/" style="font-size: 16.15px;">mybatis</a> <a href="/tags/netty/" style="font-size: 10px;">netty</a> <a href="/tags/nginx/" style="font-size: 11.54px;">nginx</a> <a href="/tags/nio/" style="font-size: 13.08px;">nio</a> <a href="/tags/nodejs/" style="font-size: 10px;">nodejs</a> <a href="/tags/postgresql/" style="font-size: 10.77px;">postgresql</a> <a href="/tags/protobuf/" style="font-size: 10px;">protobuf</a> <a href="/tags/proxy/" style="font-size: 10px;">proxy</a> <a href="/tags/push/" style="font-size: 10px;">push</a> <a href="/tags/rabbitmq/" style="font-size: 11.54px;">rabbitmq</a> <a href="/tags/redis/" style="font-size: 13.85px;">redis</a> <a href="/tags/rpc/" style="font-size: 19.23px;">rpc</a> <a href="/tags/sitemesh/" style="font-size: 10px;">sitemesh</a> <a href="/tags/sld/" style="font-size: 10px;">sld</a> <a href="/tags/slf4j/" style="font-size: 10px;">slf4j</a> <a href="/tags/socket/" style="font-size: 14.62px;">socket</a> <a href="/tags/spatialite-for-android/" style="font-size: 10px;">spatialite for android</a> <a href="/tags/spi/" style="font-size: 10px;">spi</a> <a href="/tags/spring/" style="font-size: 18.46px;">spring</a> <a href="/tags/tomcat/" style="font-size: 10.77px;">tomcat</a> <a href="/tags/transaction/" style="font-size: 10px;">transaction</a> <a href="/tags/web/" style="font-size: 10px;">web</a> <a href="/tags/xSocket/" style="font-size: 14.62px;">xSocket</a> <a href="/tags/zbus/" style="font-size: 10px;">zbus</a> <a href="/tags/zookeeper/" style="font-size: 10.77px;">zookeeper</a> <a href="/tags/数据结构/" style="font-size: 10.77px;">数据结构</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/01/">January 2016</a><span class="archive-list-count">67</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/12/">December 2015</a><span class="archive-list-count">81</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/11/">November 2015</a><span class="archive-list-count">2</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recents</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2016/01/30/资料/">(no title)</a>
          </li>
        
          <li>
            <a href="/2016/01/30/java/13.Classloader系列一/">ClassLoader系列一</a>
          </li>
        
          <li>
            <a href="/2016/01/29/hadoop/1.hadoop系列之源码编译/">hadoop系列一之源码编译</a>
          </li>
        
          <li>
            <a href="/2016/01/29/go/1.GO系列之入门/">Go系列一之入门</a>
          </li>
        
          <li>
            <a href="/2016/01/28/tomcat/2.tomcat性能优化/">tomcat性能优化</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2016 John Doe<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    


<script src="http://libs.baidu.com/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css" type="text/css">
  <script src="/fancybox/jquery.fancybox.pack.js" type="text/javascript"></script>


<script src="/js/script.js" type="text/javascript"></script>

  </div>
</body>
</html>